package com.feri.api.service.impl;

import com.feri.api.dao.HomeAreaDao;
import com.feri.api.service.intf.HomeAreaService;
import com.feri.api.vo.R;
import com.feri.common.entity.HomeArea;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * .::::.
 * .::::::::.
 * :::::::::::
 * ..:::::::::::'
 * '::::::::::::'
 * .::::::::::
 * '::::::::::::::..
 * ..::::::::::::.
 * ``::::::::::::::::
 * ::::``:::::::::'        .:::.
 * ::::'   ':::::'       .::::::::.
 * .::::'      ::::     .:::::::'::::.
 * .:::'       :::::  .:::::::::' ':::::.
 * .::'        :::::.:::::::::'      ':::::.
 * .::'         ::::::::::::::'         ``::::.
 * ...:::           ::::::::::::'              ``::.
 * ```` ':.          ':::::::::'                  ::::..
 * '.:::::'                    ':'````..
 *
 * @author wl
 * @ date 2022/10/4
 */
@Service
public class HomeAreaServiceImpl implements HomeAreaService {
    @Resource
    private HomeAreaDao dao;
    @Override
    public R save(HomeArea homeArea) {
       if (homeArea!=null){
           dao.insert(homeArea);
           return R.ok(homeArea);
       }else {
           return R.fail("新增失败");
       }
    }

    @Override
    public R queryAll() {
        return R.ok(dao.selectList(null));
    }
}
